home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Util / Pm-Pz / PrintAid 1.4.cpt / PrintAid.rsrc / TEXT_-4048.txt < prev    next >
Text File  |  1991-06-07  |  9KB  |  91 lines

  1.  
  2.  
  3.  
  4.  
  5. Copyright ¬© 1991 by James W. Walker.
  6.  
  7.  
  8. What is PrintAid?    
  9.  
  10. If you use a LaserWriter, you can print in the background with the help of Apple‚Äôs PrintMonitor.  If you use a different kind of printer, there are ‚Äúspooler‚Äù programs you can buy from several companies.  A spooler intercepts the information before it is printed, returns control of the application to you, and then sits in the background feeding the information to the printer.
  11.  
  12. If you don‚Äôt have a spooler, the next best thing is for the application to keep feeding information to the printer, but allow you to switch to another application (under MultiFinder) and work there.  If you leave it in the foreground, other applications ought to be able to run in the background.  That is the ideal of how the Macintosh‚Äôs cooperative multitasking operating system should work, and it is not difficult for the programmer to accomplish, but unfortunately most don‚Äôt do it.  Perhaps they‚Äôre worried that you will do something silly like try to print from another application before the first print job is finished.
  13.  
  14. Without getting too technical, there are basically three ways that an application can fail to support multitasking during printing:
  15.  
  16. 1. It can fail to yield any processing time to other applications while it is printing.
  17.  
  18. 2. It can tell the operating system that it doesn't want to run in the background at all.
  19.  
  20. 3. It can put up a modal dialog while printing, preventing you from switching it to the background.
  21.  
  22. I wrote the PrintAid control panel extension (INIT/cdev) to alleviate these problems.  In its most basic mode of operation, it handles just problem (1) by installing a routine which is called periodically during printing, and which allows you either to switch the printing application into the background or to run something else in its background.  Depending on the control panel settings, PrintAid can also handle problems (2) and (3).  As usual, you can cancel printing (when the printing application is in the foreground) by pressing command-period.  Let me emphasize that PrintAid is NOT A SPOOLER.  Whereas a spooler lets you do anything while printing proceeds in the background, PrintAid lets you do anything EXCEPT work in the application that is doing the printing.
  23.  
  24. The original plans for System 7 included a new printing architecture, which was to allow background printing for every printer.  That was dropped under time pressure, but presumably Apple will get around to it sooner or later, and then PrintAid will become obsolete.
  25.  
  26.  
  27. Using PrintAid    
  28.  
  29. To use PrintAid, put it into your System Folder (or, in System 7, your Control Panels folder) and restart your Mac.  You can use PrintAid‚Äôs control panel interface to turn PrintAid off, turn off its startup icon, or read this help text.  You can also specify how you want to be notified when a printing job finishes in the background: by an alert box, by a beep, or not at all.  Try it first with the default settings.  
  30.  
  31. If all goes well, you can start a printing job, then switch to another application by clicking on a window belonging to another application or by using the application icon in the menu bar.  (In System 6, you click on the icon, while in System 7 you pull down a menu.)  As mentioned below, this may not work immediately.
  32.  
  33. System 6.0.4 or later is required.
  34.  
  35.  
  36. Configuring PrintAid    
  37.  
  38. Let‚Äôs use MacWrite II as an example.  MacWrite II, like many applications, displays a modal dialog when it is printing.  Since this normally prevents you from switching out, you need to configure PrintAid so that it will hide the dialog when you try to switch to another application.  You could make this part of the default setting, but the more conservative approach is to create a custom setting for MacWrite II.  Open up the PrintAid control panel.  Pull down the pop-up menu of settings, and select ‚ÄúAdd Application‚Ķ‚Äù.  You will see a standard Open dialog, which you should use to select MacWrite II.  This creates a new setting, which is initially the same as the default setting.  Click the ‚ÄúHide Modal Dialog‚Äù checkbox.  Now close the control panel, go back to MacWrite II, and try printing again.  You should succeed in switching to another application this time, and MacWrite should continue to print.
  39.  
  40. Now let‚Äôs consider another example, TeachText.  When you print with TeachText, there is no modal dialog, so after a short delay you should be able to switch to another application.  However, as soon as you do reach another application, you will hear a beep and see an alert saying:
  41.  
  42.     PrintAid Warning: This application cannot
  43.     function in the background.  Use the ‚ÄúForce
  44.     Background Operation‚Äù setting in the PrintAid
  45.     control panel.
  46.  
  47. Obviously, the solution is to create a new setting for TeachText, with ‚ÄúForce Background Operation‚Äù turned on.
  48.  
  49. Yet another situation occurs in Amazing Paint.  The story begins like that of MacWrite II:  There is a modal dialog, so you create a custom setting with ‚ÄúHide Modal Dialog‚Äù checked.  However, when you try it, you get an alert saying:
  50.  
  51.     Sorry, this application uses its own event
  52.     handler during printing, so PrintAid will not
  53.     be able to hide a modal dialog or alert you when
  54.     printing is done.
  55.  
  56. In this situation, you must either give up on printing Amazing Paint files in the background, or resort to ResEdit.  If you open Amazing Paint with ResEdit, you can find a DLOG resource named ‚ÄúPrint Info‚Äù.  Open it up and select ‚ÄúSet 'DLOG' Characteristics‚Äù from the DLOG menu.  Change the ProcID from 1 to 9, close, and save changes.  Oh, and while you‚Äôre poking around in there, you might as well go into the SIZE resource, ID = 0, and turn on the ‚ÄúCan Background‚Äù bit.   That will make it unnessary to use ‚ÄúForce Background Operation‚Äù in PrintAid.  Standard ResEdit disclaimer:  Don‚Äôt do this to your only copy of any application.
  57.  
  58. Under System 7, you can create a custom setting for a desk accessory by selecting ‚ÄúAdd Active Process‚Äù while the DA is running.
  59.  
  60.  
  61. Limitations and Imperfections    
  62.  
  63. ‚Ä¢  You still may not get instant response to your attempt to switch to a different application during printing.  Have you noticed that printing (other than draft mode) happens in two stages?  First the application works for a while without printing, and then the printer starts up.  It is in this second stage, with the printer actually printing, that PrintAid goes into action.
  64.  
  65. ‚Ä¢  If the application is REALLY unfriendly to MultiFinder, then PrintAid may not be able to tell that it has been put in the background.
  66.  
  67. ‚Ä¢  There are likely to be some esthetic flaws, due to the fact that PrintAid cannot process update events and activate events.  (Update events are what cause windows to be redrawn when parts that were covered become exposed; activate events control things like highlighting of scroll bars and whether or not the text insertion point is visible.)  When windows need to be updated, PrintAid simply causes all of the application‚Äôs windows to be completely redrawn at the end of the print job.
  68.  
  69. ‚Ä¢  In WriteNow 2.0, the completion alert appears at the end of the first page rather than at the end of the document.  This is because WriteNow prints each page as if it were a separate document, a technique which Apple has recommended against (Tech Note 125.)
  70.  
  71.  
  72. Feedback Addresses    
  73.  
  74. America Online:   JWWalker
  75. CompuServe:   76367,2271
  76. InterNet: 76367.2271@compuserve.com
  77. U.S. Mail:¬†
  78.   James W. Walker
  79.   Department of Mathematics
  80.   University of South Carolina
  81.   Columbia, SC 29208
  82.  
  83.  
  84. Distribution Policy    
  85.  
  86. PrintAid is provided free of charge to all Macintosh users.  It may be distributed freely, provided that both the software and this documentation are always distributed together, in whole and unchanged.  PrintAid may not be sold or offered for sale, or included with another software product offered for sale, except with the express written permission of the author.  Companies that distribute public domain/freeware/shareware software for profit are expressly prohibited from distributing PrintAid.  This restriction does not apply to bulletin boards, commercial on-line services such as America Online, CompuServe and GEnie, and non-profit Macintosh user groups which hold regularly scheduled public meetings.
  87.  
  88.  
  89. Acknowledgements    
  90.  
  91. I would like to thank the people who served as beta testers for PrintAid  1.0: Brian Hall, Seth Laforge, David Lamkins, Jim Lloyd, Brian Lowry, Robert L Mathews, and Chris Morrison.